﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace WebServiceTMS
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "AuthorizeUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Login", action = "AuthorizeUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllUsers",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "User", action = "GetAllUsers", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "RegistrateNewUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "User", action = "RegistrateNewUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "RemoveUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "User", action = "RemoveUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "EditUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "User", action = "EditUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "AddNewGoal",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Goal", action = "AddNewGoal", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "RemoveGoal",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Goal", action = "RemoveGoal", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllUserGoals",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Goal", action = "GetAllUserGoals", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "EditGoal",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Goal", action = "EditGoal", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllGoals",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Goal", action = "GetAllGoals", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "AddNewTask",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "AddNewTask", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "RemoveTask",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "RemoveTask", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllTasksInGoal",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "GetAllTasksInGoal", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllUserTasks",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "GetAllUserTasks", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllTasksForUserBasedOnGoals",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "GetAllTasksForUserBasedOnGoals", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "EditTaskDescription",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "EditTaskDescription", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "ChangeTaskStatus",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "ChangeTaskStatus", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "ChangeTaskPriority",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "ChangeTaskPriority", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "ChangeTaskDates",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "ChangeTaskDates", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "AssignTaskToUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "AssignTaskToUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetTask",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Task", action = "GetTask", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "AddNewBug",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "AddNewBug", id = UrlParameter.Optional }
            ); 

            routes.MapRoute(
                name: "RemoveBug",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "RemoveBug", id = UrlParameter.Optional }
            ); 

            routes.MapRoute(
                name: "EditBug",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "EditBug", id = UrlParameter.Optional }
            ); 

            routes.MapRoute(
                name: "ChangeBugStatus",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "ChangeBugStatus", id = UrlParameter.Optional }
            );         
 
            routes.MapRoute(
                name: "GetAllBugsInTask",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "GetAllBugsInTask", id = UrlParameter.Optional }
            );     
            
            routes.MapRoute(
                name: "GetAllBugsByUser",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "GetAllBugsByUser", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetBug",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Bug", action = "GetBug", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetMainPageInfo",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "MainPage", action = "GetMainPageInfo", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetMainPageInfoAdmin",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "MainPage", action = "GetMainPageInfoAdmin", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllUserTeams",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Team", action = "GetAllUserTeams", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "GetAllTeams",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Team", action = "GetAllTeams", id = UrlParameter.Optional }
            );
        }
    }
}
